package com.gitee.neuray.security.admin.user.rpc;

import com.gitee.neuray.security.admin.api.PmUserServiceApi;
import com.gitee.neuray.security.admin.authority.FrontPermission;
import com.gitee.neuray.security.admin.authority.PermissionElementDto;
import com.gitee.neuray.security.admin.dto.LoginUserDto;
import com.gitee.neuray.security.admin.dto.PmUserDto;
import com.gitee.neuray.security.admin.result.AdminObjectRestResponse;
import com.gitee.neuray.security.admin.user.biz.AdminStaffBiz;
import com.gitee.neuray.security.admin.vo.FrontUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


/**
 * 员工基本信息rpc接口
 *
 * @author zhoyou
 * @email ${email}
 * @date 2020-03-09 03:37:55
 */
@RestController
public class AdminStaffWebApi implements PmUserServiceApi {
    @Autowired
    private AdminStaffBiz adminStaffBiz;

    @Override
    public @ResponseBody
    PmUserDto validate(@RequestBody LoginUserDto loginUser) throws Exception {
        return adminStaffBiz.validate(loginUser.getUserName(), loginUser.getPassword());
    }
    @Override
    @ResponseBody
    public List<PermissionElementDto> getPermissionByUserId(String userId)throws Exception{
        return adminStaffBiz.getPermissionByUserId(userId);
    }

}
